/***************************************************************************
 *   Copyright (C) 2005 by tonton1664                                      *
 *   tontonNOSPAM@team1664.org                                             *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef CFILE_H
#define CFILE_H

#include "internal.h"

#ifndef HANDLE
typedef uint16_t HANDLE;
#endif

/**
 * @file cfile.h
 * @author tonton1664
 * @date 2005
 * @brief Functions for reading files
 */

/**
 * Open a file for reading
 * @param filename the filename to open
 * @param handle the handle of the opened file if no error occured
 * @return 0 if no error or the error
 */
extern int __CLIB cfopen(const char* filename, HANDLE* handle);

/**
 * Close the file opened with cfopen
 * @param handle the file to close
 * @return 0 if no error or the error
 */
extern int __CLIB cfclose(HANDLE handle);

/**
 * Read data from a file
 * @param dst the far pointer where to put the data
 * @param size number of bytes to read from the file
 * @param handle the handle of the file to read
 * @return 0 if no error or the error
 */
extern int __CLIB cfread(FARPTR dst, uint16_t size, HANDLE handle);


#endif

